package com.cms.setting.banner.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cms.setting.banner.dao.BannerCatDAO;
import com.cms.setting.banner.pojo.BannerCat;
import com.cms.setting.banner.service.BannerCatService;
@Service
public class BannerCatServiceImpl implements BannerCatService {
	@Autowired
	BannerCatDAO bannerCatDAO;
	@Override
	public boolean saveBannerCat(BannerCat bannerCat) {
		if(bannerCat.getId()==null){
			return bannerCatDAO.insert(bannerCat)>0;
		}else{
			return bannerCatDAO.updateByPrimaryKey(bannerCat)>0;
		}
	}

	@Override
	public boolean deleteBannerCat(Integer catId) {
		return bannerCatDAO.deleteByPrimaryKey(catId)>0;
	}

	@Override
	public BannerCat findByCatId(Integer catId) {
		return bannerCatDAO.selectByPrimaryKey(catId);
	}

	@Override
	public List<BannerCat> findList() {
		return bannerCatDAO.findByList();
	}
	

}
